TESLA Tutorial

Author: Jian Hu, Kyle Coleman, Edward B. Lee, Humam Kadara, Linghua Wang, Mingyao Li*

Outline

1. Installation

2. Import modules

3. Read in data

4. Gene expression enhancement

5. Region annotation

6. Characterize the intra-tumor heterogeneity

7. TLS detection

1. Installation

To install TESLA package you must make sure that your python version is over 3.5.=. If you don’t know the version of python you can check it by:

Note: Because SpaGCN pends on pytorch, you should make sure torch is correctly installed.
Now you can install the current release of SpaGCN by the following three ways:

1.1 PyPI: Directly install the package from PyPI.

1.2 Github

Download the package from Github and install it locally:

1.3 Anaconda ()

If you do not have Python3.5 or Python3.6 installed, consider installing Anaconda (see Installing Anaconda). After installing Anaconda, you can create a new environment, for example, SpaGCN (you can change to any name you like).

2. Import python modules

3. Read in data

The current version of SpaGCN requres three input data:

  1. The gene expression matrix(n by k): expression_matrix.h5;
  2. Spatial coordinateds of samplespositions.txt;
  3. Histology image(optional): histology.tif, can be tif or png or jepg.
    The gene expreesion data can be stored as an AnnData object. AnnData stores a data matrix .X together with annotations of observations .obs, variables .var and unstructured annotations .uns.

4. Gene expression enhancement

4.1 Preprocessing

4.2 Contour detection

4.3 Gene expression enhancement

4.4 Plot gene expression image

4.5 Save results

5. Region annotation

5.1 Target region annotation

5.2 Save results

6. Characterize the intra-tumor heterogeneity

6.1 Read in saved results

6.2 Leading edge detection

6.3 Tumor edge and core separation

6.4. Core vs core DE analysis

6.5. Plot core/edge enriched genes

6.6 Plot ome examples

7. TLS detection

7.1 Read in cell type annotations

Before runing TLS detection, please detect B, CD4+T, DC and CXCL13.

7.2 Calculate TLS score

7.3 Plot TLS score